package com.chinasoft.bean.controller;

import com.chinasoft.bean.Student;
import com.chinasoft.bean.service.StudentService;
import com.chinasoft.bean.service.impl.StudentServiceImpl;
import org.junit.Test;

import java.util.List;

public class StudentController {
    private StudentService service = new StudentServiceImpl();

    @Test
    public void selectAll(){
        List<Student> studentList = service.selectAll();
        studentList.forEach(System.out::println);
    }

    @Test
    public void selectById(){
        System.out.println(service.selectById(3));
    }

    @Test
    public void insert (){
        service.insert(new Student(6,"刘刚",30));
    }

    @Test
    public  void update(){
        service.update(new Student(6,"liugang",38));
    }

    @Test
    public  void delete(){
        service.delete(6);
    }
}